package org.example.hrpc.example;

import org.example.hrpc.config.reference.ReferenceConfig;
import org.example.hrpc.config.service.ServiceConfig;

import java.io.IOException;

public class HelloClient {
    public static void main(String[] args) throws IOException {
        ReferenceConfig<HelloService> referenceConfig = new ReferenceConfig<>();

        referenceConfig.setInterfaceName(HelloService.class.getName());
        referenceConfig.setBindToHost("127.0.0.1");
        referenceConfig.setBindToPort(30000);

        referenceConfig.init();

        HelloService helloService = referenceConfig.get();
        System.out.println(helloService);
        String res = helloService.hello("World");
        System.out.println(res);
        System.in.read();
    }
}
